import request from '@/utils/request'


const taskinfo = {
  pageList:(pageNum,pageSize)=> {
    return request({
      url: '/taskinfo/pagelist',
      method: 'get',
      params:{pageNum,pageSize}
    })
  },
  /* 保存 */
  save:(data)=> {
    return request({
      url: '/taskinfo/save',
      method: 'post',
      data
    })
  },

  remove:(id)=> {
    return request({
      url: '/taskinfo/del/'+id,
      method: 'delete',
      data
    })
  },

  updateById:(data)=> {
    return request({
      url: '/taskinfo/update',
      method: 'post',
      data
    })
  },

  getOne:(id)=> {
    return request({
      url: '/taskinfo/'+id,
      method: 'get',
      data
    })
  },
  exportExcel:(data)=> {
     /* const config = {}
     config.data = data */
    return request({
      headers: {'Content-Type':'application/json;charset=UTF-8'},
      url: '/taskinfo/exportExcel',
      method: 'post',
      responseType: 'blob',// 表明返回服务器返回的数据类型，要加在请求头里面，否则识别不了文件流
      //...config
      data
    })
  }

}

export default taskinfo;
